package com.example.edu.domain.dto;

import com.example.edu.validate.AddGroup;
import com.example.edu.validate.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author yanzhao
 * @date 2022/1/13 14:19
 * @since 1.0.0
 */
@Data
public class DependencyDTO implements Serializable {

    @NotNull(groups = UpdateGroup.class, message = "{id}")
    private Long id;
    @Length(groups = {UpdateGroup.class, AddGroup.class}, max = 128, message = "{dependency.groupId.length}")
    @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "{dependency.groupId}")
    private String groupId;
    @Length(groups = {UpdateGroup.class, AddGroup.class}, max = 128, message = "{dependency.artifactId.length}")
    @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "{dependency.artifactId}")
    private String artifactId;
    @Length(groups = {UpdateGroup.class, AddGroup.class}, max = 64, message = "{dependency.version.length}")
    @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "{dependency.version}")
    private String version;
    @Length(groups = {UpdateGroup.class, AddGroup.class}, max = 32, message = "{dependency.scope.length}")
    private String scope;
    @Length(groups = {UpdateGroup.class, AddGroup.class}, max = 32, message = "{dependency.optional.length}")
    private String optional;
}
